<script type="text/javascript">
    var baseUrl = '<?php echo $this->baseUrl(); ?>';
</script> 
<?php $cliente = $this->cliente;?>
    <h3>
        <p style="text-height: max-size;"class="text-info">
            Datos de Ingresos:
            <?php echo $cliente->getApellido() . '&nbsp;&nbsp' . $cliente->getNombre(); ?>
        </p> 
    </h3>
<?php $ingreso = $this->ingreso; $tipoSesion = $ingreso->getTipoSesion(); ?>
<form id="editar_ingreso" name="editar_ingreso" class="form-horizontal" method="Get" action="<?php echo $this->baseUrl("clientes/cliente/registrar/accion/editaringreso") ?>">
    <input class="hidden" type="text" id="ingreso_id" name="ingreso_id" value="<?php echo $ingreso->getId();?>">
    <input class="hidden" type="text" id="cliente_id" name="cliente_id" value="<?php echo $this->cliente_id;?>">
    <input class="hidden" type="text" id="editarsesion" name="editaringreso" value="editaringreso">
    <legend>Editar Ingreso</legend> 
    <table>
        <tbody>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label">Tipo Sesion</label>
                        <div class="controls input-medium">
                            <select id="tipo_sesion" name="tipo_sesion">
                                <option value="<?php echo $tipoSesion->getId(); ?>"><?php echo $tipoSesion->getDescripcion();  ?></option>
                                <?php foreach ($this->tiposSesiones as $tipoSesion): ?>
                                    <option value="<?php echo $tipoSesion->getId(); ?>"><?php echo $tipoSesion->getDescripcion(); ?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>
                </td>
                 <td>
                    <div class="control-group">
                        <label class="control-label">Fecha</label>
                        <div class="controls">
                            <input class="input-small datepicker" type="text" id="fecha_ingreso" name="fecha_ingreso" placeholder="Fecha" value="<?php echo  $ingreso->getFechaCarga()->format('d/m/Y'); ?>">
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label">Cantidad</label>
                        <div class="controls">
                            <select id="cant_sesion" name="cant_sesion">
                                <option value="<?php echo $ingreso->getCantidad(); ?>"><?php echo $ingreso->getCantidad(); ?></option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="5">5</option>
                                <option value="10">10</option>
                            </select>
                        </div>
                    </div>
                </td>
               
                <td>
                    <div class="control-group">
                        <label class="control-label">Monto</label>
                        <div class="controls">
                            <input class="input-small" type="text" id="text_monto" name="text_monto" placeholder="Dif Monto" value="<?php echo $ingreso->getMonto(); ?>">
                        </div>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <input style="width: 200px;" class="btn btn-primary btn-large " type="submit" name="accion" id="guardar" value="Guardar">
    <legend></legend>
</form>    
<script type="text/javascript">
//    $(document).ready(function(){
//        $( ".datepicker" ).datepicker({dateFormat: 'dd/mm/yy',changeMonth:true,changeYear:true});
//        $(".ingreso_activo").colorbox({
//            iframe:true, 
//            innerWidth: "60%", 
//            innerHeight: "60%",
//            onClosed:function(){ location.reload(true); } });
//
//    });
    $(document).ready(function(){
        $('a.title').cluetip({splitTitle: '|'});
        $( ".datepicker" ).datepicker({dateFormat: 'dd/mm/yy',changeMonth:true,changeYear:true});
        
        $("#editar_ingreso").validate({
        ignoreTitle: true,
        errorPlacement: false,
        rules: {
            /* ingreso */
            tipo_sesion: {required: true},
            cant_sesion: {required: true},
            text_monto: {required: true},
            fecha_ingreso: {required: true, dateITA: true}
        },
        highlight: function(element, errorClass) {
            $(element).attr('style', 'border:1px solid red; background-color:#FF7373; color:black;');
        },
        unhighlight: function(element, errorClass, validClass) {
            $(element).attr("style", "");
        },
        errorPlacement: function(error, element) {
        }
    });
    });
</script>